package com.chenfan.ccp.autoconfigure;

import com.chenfan.ccp.util.start.ApplicationContextUtil;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public abstract class AbstractAutoConfigure implements ApplicationContextAware {


    private ApplicationContext applicationContext;

    protected ApplicationContext getApplicationContext() {
        return applicationContext;
    }

    @Override
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
        ApplicationContextUtil.setContext(applicationContext);
        this.applicationContext = applicationContext;
    }
}
